using System;
using System.Reflection;
using System.Linq.Expressions;

namespace Octubre.Framework
{
	public class PropertyNotInitialized : Exception
	{
		public readonly PropertyInfo Property;
		public PropertyNotInitialized(PropertyInfo property)
		{
			this.Property = property;
		}

		public static PropertyNotInitialized This<T>(Expression<Func<T>> expr)
		{
			return new PropertyNotInitialized((expr.Body as MemberExpression).Member as PropertyInfo);
		}
	}
}

